package cn.jxau.bean.po;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotations.KeySequence;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;

@TableName("t_usercollections")//必须指定表名
@KeySequence("t_sequence_usercollections")//使用oracle序列自动递增
public class UserCollections implements Serializable{
	private static final long serialVersionUID = 1L;
	@TableId(type=IdType.INPUT)
	private Long id;//id
	private Long userID;//角色id
	private Long articleID;//文章ID
	private Long usertypeID; //用户收藏文章类型ID
	@JsonFormat(pattern="yyyy-MM-dd hh:mm:ss")
	private Date tDate = new Date();
	@TableField(exist=false)
	private UserCollectionsType userCollectionsType; //用户收藏类型对象
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getUserID() {
		return userID;
	}
	public void setUserID(Long userID) {
		this.userID = userID;
	}
	public Long getArticleID() {
		return articleID;
	}
	public void setArticleID(Long articleID) {
		this.articleID = articleID;
	}
	public Long getUsertypeID() {
		return usertypeID;
	}
	public void setUsertypeID(Long usertypeID) {
		this.usertypeID = usertypeID;
	}
	public Date gettDate() {
		return tDate;
	}
	public void settDate(Date tDate) {
		this.tDate = tDate;
	}
	public UserCollectionsType getUserCollectionsType() {
		return userCollectionsType;
	}
	public void setUserCollectionsType(UserCollectionsType userCollectionsType) {
		this.userCollectionsType = userCollectionsType;
	}
	@Override
	public String toString() {
		return "UserCollections [id=" + id + ", userID=" + userID + ", articleID=" + articleID + ", usertypeID="
				+ usertypeID + ", tDate=" + tDate + ", userCollectionsType=" + userCollectionsType + "]";
	}
	public UserCollections(Long id, Long userID, Long articleID, Long usertypeID, Date tDate,
			UserCollectionsType userCollectionsType) {
		super();
		this.id = id;
		this.userID = userID;
		this.articleID = articleID;
		this.usertypeID = usertypeID;
		this.tDate = tDate;
		this.userCollectionsType = userCollectionsType;
	}
	public UserCollections() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((articleID == null) ? 0 : articleID.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((tDate == null) ? 0 : tDate.hashCode());
		result = prime * result + ((userCollectionsType == null) ? 0 : userCollectionsType.hashCode());
		result = prime * result + ((userID == null) ? 0 : userID.hashCode());
		result = prime * result + ((usertypeID == null) ? 0 : usertypeID.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserCollections other = (UserCollections) obj;
		if (articleID == null) {
			if (other.articleID != null)
				return false;
		} else if (!articleID.equals(other.articleID))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (tDate == null) {
			if (other.tDate != null)
				return false;
		} else if (!tDate.equals(other.tDate))
			return false;
		if (userCollectionsType == null) {
			if (other.userCollectionsType != null)
				return false;
		} else if (!userCollectionsType.equals(other.userCollectionsType))
			return false;
		if (userID == null) {
			if (other.userID != null)
				return false;
		} else if (!userID.equals(other.userID))
			return false;
		if (usertypeID == null) {
			if (other.usertypeID != null)
				return false;
		} else if (!usertypeID.equals(other.usertypeID))
			return false;
		return true;
	}
	
	
	
}
